package com.qf.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 删除员工
 * @author 千锋健哥
 */
@WebServlet("/delete")
public class DeleteEmpController extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1. 接收需要删除的数据的主键id

        //2. 调用service完成删除功能

        //3. 删除后跳转到查询列表页面, 展示最新数据
        resp.sendRedirect("/empList");
    }

}
